function editUserController($scope, $http, $stateParams,$state) {
    $scope.accountName = $stateParams.accountName;

    $scope.editUser = null;
    $scope.universityList = [{name:"武汉大学"},{name:"华中科技大学"},{name:"清华大学"},{name:"北京大学"},{name:"上海交通大学"},{name:"复旦大学"}];


    var getCurrentUser = function () {
        $http({
            url: '/userLogin/getCurrentUser',
            method: 'GET'
        }).success(function (response) {

            console.log("response: " + response);
            $scope.editUser = response;
            if($scope.editUser == null){
                alert("用户名或者密码错误！");
                $state.go('login');
            }


        }).error(function (response) {
            alert('error')
        })
    };
    getCurrentUser();

    $scope.submitEditUser = function () {
        console.log("start loging");
        $scope.editUser.accountName = $scope.accountName;
        console.log("editUser.accountName: " + $scope.editUser.accountName);

        $http({
            url: '/userLogin/editUser',
            method: 'POST',
            data: $scope.editUser

        }).success(function (response) {

            console.log("response: " + response);
            var message = response.resultMessage;

            if (message == "success") {

                // localStorage.setItem("token", "Bearer " + content)
                // console.log("whole token： " + localStorage.getItem("token"))
                console.log("scope.user: "+$scope.editUser.accountName);
                $state.go('userCenter',{accountName : $scope.editUser.accountName,password:111});
            }

        }).error(function (response) {
            alert('error')
        })


    };

    $scope.gotoPhotoStart = function () {
        $state.gotoPhotoStart('photoStart ');

    }
    $scope.returnCenter = function () {
        $state.go("userCenter",{accountName: $scope.accountName,password:111})
    };

    var  editUserInfo = function () {

    }


}
